package com.yowasa.xiuxian.engine.hone.mental;


import com.google.common.collect.Lists;
import com.yowasa.xiuxian.annoations.Mental;
import com.yowasa.xiuxian.constant.XiuxianConstants;
import com.yowasa.xiuxian.engine.hone.MentalInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.bo.user.UserBattle;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.exception.HandlerException;

import java.util.List;

@Mental(name = "玉清仙法")
public class YuQingXianFa implements MentalInterface {


    @Override
    public ElementEnum getElement() {
        return ElementEnum.WATER;
    }

    @Override
    public void limit(UserBO user) {
        if (user.getElement().get("水") < XiuxianConstants.DEFAULT_ELEMENT_ACTIVITY) {
            throw new HandlerException("修习玉清仙法必须具有水灵根");
        }
        if (user.getUserAttr().getInts() < 40) {
            throw new HandlerException("修习玉清仙法气感最低要40");
        }
    }

    @Override
    public String limitDesc() {
        return "具有水灵根且气感最低要40";
    }

    @Override
    public String desc() {
        return "水属性心法,特点是能大幅提高修习者的术法攻防和灵气最大值,对修习者气感有一定要求";
    }

    @Override
    public List<String> bsList() {
        return Lists.newArrayList("摧心浪","清心咒","术法攻击");
    }

    @Override
    public String breakUp(UserBO user) {
        UserBattle upBattle = getBaseUp(user);
        upBattle.setMp(upBattle.getMp() * 2);
        upBattle.setCmp(upBattle.getMp());
        upBattle.setSpell((int)((upBattle.getSpell() + 5) * 1.5));
        upBattle.setRes((int)((upBattle.getRes()+2) * 1.5));
        buildNewUpBattle(user, upBattle);
        return upBattle.getUpDesc();
    }

    @Override
    public List<String> specialList() {
        return Lists.newArrayList("采水诀");
    }


}
